Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add source_file to incus_storage_bucket #160

Merged
merged 2 commits into from
Nov 21, 2024

Conversation

SpiffyEight77
Copy link
Contributor

@SpiffyEight77 SpiffyEight77 commented Nov 15, 2024

Description

Close #127

Add source_file to incus_storage_bucket

  • source code
  • document
  • test case

Testing

root@playground:~/terraform-incus# incus storage bucket create default mybucket
Storage bucket "mybucket" created
Admin access key: 20UYEVYRYC11LAX0L1UQ
Admin secret key: 6t7ETtVRR9getp3oIUOQuKFYWHRLR52JONe7cktX
root@playground:~/terraform-incus# incus storage bucket list default
+----------+-------------+
|   NAME   | DESCRIPTION |
+----------+-------------+
| mybucket |             |
+----------+-------------+

root@playground:~/terraform-incus# incus storage bucket export default mybucket
Backup exported successfully!

root@playground:~/terraform-incus# incus storage bucket delete default mybucket
Storage bucket "mybucket" deleted
root@playground:~/terraform-incus# incus storage bucket ls default
+------+-------------+
| NAME | DESCRIPTION |
+------+-------------+


root@playground:~/terraform-incus# terraform apply
......
Terraform will perform the following actions:

  # incus_storage_bucket.bucket_from_backup will be created
  + resource "incus_storage_bucket" "bucket_from_backup" {
      + config      = {}
      + location    = (known after apply)
      + name        = "restored-bucket"
      + pool        = "default"
      + source_file = "/root/terraform-incus/backup.tar.gz"
      + target      = (known after apply)
        # (1 unchanged attribute hidden)
    }

Plan: 1 to add, 0 to change, 0 to destroy.

Do you want to perform these actions?
  Terraform will perform the actions described above.
  Only 'yes' will be accepted to approve.

  Enter a value: yes

incus_storage_bucket.bucket_from_backup: Creating...
incus_storage_bucket.bucket_from_backup: Creation complete after 1s [name=restored-bucket]

Apply complete! Resources: 1 added, 0 changed, 0 destroyed.

root@playground:~/terraform-incus# incus storage bucket ls default
+-----------------+-------------+
|      NAME       | DESCRIPTION |
+-----------------+-------------+
| restored-bucket |             |
+-----------------+-------------+

@SpiffyEight77 SpiffyEight77 force-pushed the feat/import-storage-bucket branch 2 times, most recently from d203c99 to 8462ab4 Compare November 20, 2024 15:42
@SpiffyEight77 SpiffyEight77 marked this pull request as ready for review November 20, 2024 17:26
@SpiffyEight77 SpiffyEight77 force-pushed the feat/import-storage-bucket branch from 8462ab4 to 99c2b6d Compare November 21, 2024 14:31
@maveonair maveonair merged commit ae4861a into lxc:main Nov 21, 2024
9 of 10 checks passed
@SpiffyEight77 SpiffyEight77 deleted the feat/import-storage-bucket branch November 22, 2024 02:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Add source_file to incus_storage_bucket
2 participants